package cn.iocoder.yudao.module.resource.convert;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.resource.controller.admin.creator.vo.ResourceCreatorRespVO;
import cn.iocoder.yudao.module.resource.dal.dataobject.creator.ResourceCreatorDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

@Mapper
public interface ResourceCreatorConvert {

    ResourceCreatorConvert INSTANCE = Mappers.getMapper(ResourceCreatorConvert.class);

    default ResourceCreatorRespVO convert(ResourceCreatorDO bean) {
        return BeanUtils.toBean(bean, ResourceCreatorRespVO.class);
    }

    default PageResult<ResourceCreatorRespVO> convertPage(PageResult<ResourceCreatorDO> page) {
        return BeanUtils.toBean(page, ResourceCreatorRespVO.class);
    }

}
